
import java.util.Scanner;

public class Main2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        //n个数据
        int n = scanner.nextInt();
        //指令
        String directive = scanner.next();

        char[] order = directive.toCharArray();
        //光标的位置
        int mouse = 1;
        //第几页
        int first = 1;

        //分n <= 4  和 n > 4  的两种情况
        if (n <= 4) {
            for (int i = 0; i < order.length; i++) {
                if (mouse == 1 && order[i] == 'U') {
                    mouse = n;
                } else if (mouse == n && order[i] == 'D') {
                    mouse = 1;
                } else if (order[i] == 'U') {
                    mouse--;
                } else if (order[i] == 'D') {
                    mouse++;
                }
            }
            for (int i = 1; i < n; i++) {
                System.out.print(i + " ");
            }
            System.out.println(n);
            System.out.println(mouse);
        } else {
            for (int i = 0; i < order.length; i++) {
                if (first == 1 && mouse == 1 && order[i] == 'U') {
                    first = n - 3;
                    mouse = n;
                } else if (first == n - 3 && mouse == n && order[i] == 'D') {
                    first = 1;
                    mouse = 1;
                } else if (first != 1 && mouse == first && order[i] == 'U') {
                    first--;
                    mouse--;
                } else if (first != n - 3 && mouse == first + 3 && order[i] == 'D') {
                    first++;
                    mouse++;
                } else if (order[i] == 'U') {
                    mouse--;
                } else if (order[i] == 'D') {
                    mouse++;
                }
            }
            for (int i = first; i < first + 3; i++) {
                System.out.print(i + " ");
            }
            System.out.println(first + 3);
            System.out.println(mouse);
        }

    }
}
